|
Neurosis Engine
|
00001 00002 // Neurosis Engine - LP23.com 00003 // Copyright © Luigi Pino. All rights reserved. 00004 00005 /***************************************************************************/ 00006 00007 #ifndef _NEUROSIS_ENGINE_NEUROSIS_H_ 00008 #define _NEUROSIS_ENGINE_NEUROSIS_H_ 00009 00010 /***************************************************************************/ 00011 00012 #pragma warning(disable:4100) // "unreferenced formal parameter" (openAL) 00013 #pragma warning(disable:4238) // "nonstandard extension used" 00014 #pragma warning(disable:4701) // "local variable not initialized" (openAL) 00015 #pragma warning(disable:4702) // "unreachable code" 00016 00017 /***************************************************************************/ 00018 00019 #include "custom.h" 00020 #include "stdafx.h" 00021 00022 /***************************************************************************/ 00023 00024 #include <afxwin.h> // Instead of <windows.h> to allow for MFC compatibility 00025 #include <gl\gl.h> // OpenGL 00026 #include <gl\glu.h> // OpenGL 00027 #include <assert.h> // --> Assert() 00028 #include <atlstr.h> // --> CString 00029 #include <list> // --> std::list 00030 #include <math.h> // Math 00031 #include <mmsystem.h> // Multimedia 00032 #include <process.h> // --> exit() 00033 #include <regstr.h> // Registry 00034 #include <stdio.h> // Standard Input/Output 00035 #include <time.h> // Timer 00036 00037 /***************************************************************************/ 00038 00039 //------------------------------------------------ 00040 #define NEUROSIS_VERSION 1.42f 00041 //------------------------------------------------ 00042 #define PI 3.141592653589793238462643383279f 00043 #define RADIAN_DEGREES 57.295779513082320876798154814114f 00044 //------------------------------------------------ 00045 00046 /***************************************************************************/ 00047 00049 void Angle_Adjust(float *current, float destination, float amount); 00050 00052 int Angle_Closer(float angle1, float angle2, float angleCompare); 00053 00055 float Angle_Difference(float angle1, float angle2); 00056 00058 bool Angle_Inside(float angleBegin, float angleEnd, float angleCompare); 00059 00061 float Calculate_Distance(float3 *current, float3 *destination); 00062 00064 float Calculate_Distance_2D(float3 *current, float3 *destination); 00065 00067 int Calculate_Random(int upperLimit); 00068 00070 float Calculate_Rotation_x(float3 *base, float3 *point); 00071 00073 float Calculate_Rotation_z(float3 *base, float3 *point); 00074 00076 template <class T> 00077 void Clamp(T *value, T min, T max, bool rollOver); 00078 00080 float3 Cross_Product(float3 *value1, float3 *value2); 00081 00083 float Dot_Product(float3 *value1, float3 *value2); 00084 00086 template <class T> 00087 bool Goal(T *current, T goal, T amount); 00088 00090 CString Retrieve_Neurosis_Version(); 00091 00093 CString Retrieve_Windows_Version(); 00094 00096 void Rotate_x(float3 *base, float3 *point, float amount); 00097 00099 void Rotate_y(float3 *base, float3 *point, float amount); 00100 00102 void Rotate_z(float3 *base, float3 *point, float amount); 00103 00105 void Scale_Length(float3 *base, float3 *point, float amount); 00106 00107 /***************************************************************************/ 00108 00109 template <class T> 00110 void Clamp(T *value, T min, T max, bool rollOver) 00111 00112 { 00113 if (rollOver == true) 00114 { 00115 while (*value > max) 00116 *value = *value - (max - min); 00117 while (*value < 0.0f) 00118 *value = *value + (max - min); 00119 } 00120 else 00121 { 00122 if (*value > max) 00123 *value = max; 00124 else if (*value < min) 00125 *value = min; 00126 } 00127 } 00128 00129 /***************************************************************************/ 00130 00131 template <class T> 00132 bool Goal(T *current, T goal, T amount) 00133 00134 { 00135 if (*current > goal) 00136 { 00137 *current = *current - amount; 00138 if (*current < goal) 00139 *current = goal; 00140 return (true); 00141 } 00142 else if (*current < goal) 00143 { 00144 *current = *current + amount; 00145 if (*current > goal) 00146 *current = goal; 00147 return (true); 00148 } 00149 00150 return (false); 00151 } 00152 00153 /***************************************************************************/ 00154 00155 #include "audio.h" 00156 #include "base64.h" 00157 #include "camera.h" 00158 #include "io_file.h" 00159 #include "io_pak.h" 00160 #include "network.h" 00161 #include "window.h" 00162 #include "io_misc.h" // needs window.h 00163 #include "model.h" // needs window.h 00164 #include "physics.h" // needs model.h 00165 00166 /***************************************************************************/ 00167 #endif
1.7.6.1